/**
 * 获取信息
 * @returns {string}
 */


 export const getLocalStorage = (name) => {
     return JSON.parse(localStorage.getItem(name))
 } 
 

 /**
  * 设置信息
  * @param {object} userInfo
  */

export const setLocalStorage = (name, userInfo) =>{
    return localStorage.setItem(name,JSON.stringify(userInfo))
}


/**
 * 削除信息
 */
export const deLcalStorage = (name) => {
    return localStorage.removeItem(name)
}

/**
 * 多语言由于之前的配置，再次传递给接口前今行转化
 * locale: getLocalStorage('lang') == '1' ? 'zh' : getLocalStorage('lang') == '0' ? 'jp' : 'en',
 * 0 jp  1 zh   2en  => 
 * 0 en  1 jp   2zh
 */

export const getLang = () => {
    return JSON.parse(localStorage.getItem('lang')) == "0" ? "1" : JSON.parse(localStorage.getItem('lang')) == "1" ? "2" : "0";
} 
